<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增用户')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-user-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">用户编码：</label>
                <div class="col-sm-8">
                    <input name="userCode" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">用户密码：</label>
                <div class="col-sm-8">
                    <input name="password" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">用户性别：</label>
                <div class="col-sm-8">
                    <select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">出生日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="barthday" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">用户电话：</label>
                <div class="col-sm-8">
                    <input name="phone" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">用户地址：</label>
                <div class="col-sm-8">
                    <input name="address" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">学历编码：</label>
                <div class="col-sm-8">
                    <select class="form-control m-b" id="educationCode" name="educationCode">
                        <option th:each="v : ${all1}" th:text="${v.educationName}" th:value="${v.educationCode}"></option>
                    </select>
                    <!--<input name="educationCode" class="form-control" type="text">-->
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">角色编码：</label>
                <div class="col-sm-8">
                    <select class="form-control m-b" id="roleCode" name="roleCode">
                        <option th:each="v : ${all}" th:text="${v.roleName}" th:value="${v.roleCode}"></option>
                    </select>
                    <!--<select name="roleCode" class="form-control m-b">
                        <option value="">所有</option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>-->
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/u_user"
        $("#form-user-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-user-add').serialize());
            }
        }

        $("input[name='barthday']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        /*function codeAndName() {
            Set<Map.Entry<String, Object>> entries = map.entrySet();

            for (Map.Entry<String, Object>entry:entries){
                //String value = entry.getValue();
                String key = entry.getKey();
            }
        }*/


    </script>
</body>
</html>